1. Field of the Invention
The present invention relates to a method of detecting a data structure of data in an optical storage device, and more particularly, to a method of obtaining leading zeros and trailing zeros from fourteen-bit data.
2. Description of the Prior Art
In the prior rewritable optical recording system, 8-bit symbol data should be encoded in non-return-to-zero (NRZ) format and be transformed into 14-bit channel bit data, the two steps together being called eight-to-fourteen-modulation. According to the Red Book, when the data “0” appears in a data stream of 14 bits, the run-length of “0” is limited to shorter than 11T and longer than 3T, this being called run-length rule. The run-length is limited to maintain the linear speed of the compact disc according to the data stream of 14 bits. 3T represents a 720 KHz signal with the linear speed 1.2 m/s and 11T represents a 196 KHz signal with the linear speed 1.2 m/s, with any signal out of the standard timing being regarded as an error message.
In addition, the digital sum value is generated by the NRZ of the 14 bits. This helps the average potential of the NRZ of the 14 bits to be close to the DC potential. According to the Red Book, three merging bits must be inserted into any two data streams of 14 bits for complying with the run-length rule and for keeping the average potential of the NRZ of the 14 bits near the DC potential. The ideal merging bits are calculated after getting the leading and trailing zeros of the two data streams of 14 bits.
The prior art requires two memories or registers to record the former 14 bits and the latter 14 bits, inputting the data of the two registers into a corresponding leading zero counter and a corresponding trailing zero counter to count the number of the leading and trailing zeros, respectively. However, this requires more memory and a complex decoding circuit, and thus, requires improvement.